<?php

/**
 * tblHotel form base class.
 *
 * @method tblHotel getObject() Returns the current form's model object
 *
 * @package    travis
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasetblHotelForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'name_en'        => new sfWidgetFormInputText(),
      'name_he'        => new sfWidgetFormInputText(),
      'name_ru'        => new sfWidgetFormInputText(),
      'provider_id'    => new sfWidgetFormInputText(),
      'provider_code'  => new sfWidgetFormInputText(),
      'country_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CountryHotel'), 'add_empty' => true)),
      'region_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('RegionHotel'), 'add_empty' => true)),
      'city_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CityHotel'), 'add_empty' => true)),
      'stars'          => new sfWidgetFormInputText(),
      'address'        => new sfWidgetFormInputText(),
      'phone1'         => new sfWidgetFormInputText(),
      'phone2'         => new sfWidgetFormInputText(),
      'fax'            => new sfWidgetFormInputText(),
      'email'          => new sfWidgetFormInputText(),
      'web_site'       => new sfWidgetFormInputText(),
      'description_en' => new sfWidgetFormInputText(),
      'description_ru' => new sfWidgetFormInputText(),
      'description_he' => new sfWidgetFormInputText(),
      'reputation'     => new sfWidgetFormInputText(),
      'latitude'       => new sfWidgetFormInputText(),
      'longitude'      => new sfWidgetFormInputText(),
      'photo'          => new sfWidgetFormInputText(),
      'priority'       => new sfWidgetFormInputText(),
      'update_time'    => new sfWidgetFormDateTime(),
      'create_time'    => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'name_en'        => new sfValidatorPass(array('required' => false)),
      'name_he'        => new sfValidatorPass(array('required' => false)),
      'name_ru'        => new sfValidatorPass(array('required' => false)),
      'provider_id'    => new sfValidatorInteger(array('required' => false)),
      'provider_code'  => new sfValidatorPass(array('required' => false)),
      'country_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CountryHotel'), 'required' => false)),
      'region_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('RegionHotel'), 'required' => false)),
      'city_id'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CityHotel'), 'required' => false)),
      'stars'          => new sfValidatorInteger(array('required' => false)),
      'address'        => new sfValidatorPass(array('required' => false)),
      'phone1'         => new sfValidatorPass(array('required' => false)),
      'phone2'         => new sfValidatorPass(array('required' => false)),
      'fax'            => new sfValidatorPass(array('required' => false)),
      'email'          => new sfValidatorPass(array('required' => false)),
      'web_site'       => new sfValidatorPass(array('required' => false)),
      'description_en' => new sfValidatorPass(array('required' => false)),
      'description_ru' => new sfValidatorPass(array('required' => false)),
      'description_he' => new sfValidatorPass(array('required' => false)),
      'reputation'     => new sfValidatorPass(array('required' => false)),
      'latitude'       => new sfValidatorPass(array('required' => false)),
      'longitude'      => new sfValidatorPass(array('required' => false)),
      'photo'          => new sfValidatorPass(array('required' => false)),
      'priority'       => new sfValidatorInteger(array('required' => false)),
      'update_time'    => new sfValidatorDateTime(array('required' => false)),
      'create_time'    => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('tbl_hotel[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'tblHotel';
  }

}
